﻿using System;
using System.Configuration;

namespace Alex.Library.Log.Configuration
{
    /// <summary>
    /// XML日志文件元素
    /// </summary>
    public sealed class XmlLoggerElement : FileLoggerElement
    {
        /// <summary>
        /// 日志文件类型，默认是.log
        /// </summary>
        [ConfigurationProperty("fileExtension", IsRequired = false)]
        public new XmlFileExtensionContentElement FileExtension
        {
            get
            {
                return (XmlFileExtensionContentElement)this["fileExtension"];
            }
        }

        /// <summary>
        /// 获取日志对象
        /// </summary>
        /// <returns></returns>
        public override ILogger GetLogger()
        {
            FileLogger fl = (FileLogger)base.GetLogger();
            return new XmlLogger(fl);
        }
    }
}
